﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MSRoboticsFramework.ActuatorLayer.Actuators.Motors
{
    /// <summary>
    /// Generic motor.
    /// 
    /// Keep in mind that positive angles mean a forward movement and
    /// negative angles mean a backward movement.
    /// </summary>
    public interface IGenericMotor
    {
        /// <summary>
        /// The angle of the motor (in radians) in relation to its initial position
        /// when the class instance was created. A value ranging from -Pi to Pi.
        /// 
        /// Values out of bounds are wrapped around to values into the allowed range.
        /// </summary>
        public float Angle { get; set; }

        /// <summary>
        /// The speed of the motor. A decimal value ranging between 0 and 1,
        /// where 0 is stoped and 1 is maximum speed. The speed value affects all motion
        /// operations over the motor.
        /// 
        /// Values out of bounds are converted to limit values.
        /// </summary>
        public float Speed { get; set; }

        /// <summary>
        /// Asynchronously make the motor turn forward indefinitely.
        /// </summary>
        public void Forward();

        /// <summary>
        /// Asynchronously make the motor turn backward indefinitely.
        /// </summary>
        public void Backward();

        /// <summary>
        /// Stops any motion this motor is performing and "brakes" the motor.
        /// </summary>
        public void Brake();

        /// <summary>
        /// Stops any motion this motor is performing and lets the motor coast.
        /// </summary>
        public void Coast();
    }
}
